<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>

</head>

<body>

    <ul id="list">
        <li>1</li>
        <li>2</li>
        <li>3</li>
        <li>4</li>
    </ul>

    <p> p tag 1</p>

    <b>b tag 2</b>

    <div>div tag 3</div>

    <script>

        document.onclick = function (e) {
            //dom
            if (e.target.tagName === 'P') {
                console.log(1);
            }
            if (e.target.tagName === 'B') {
                console.log(2);
            }
            if (e.target.tagName === 'DIV') {
                console.log(3);
            }
        }



    </script>

</body>

</html>